#include <stdio.h>
#include <math.h>

int reverse(int n) {
    if (0<=n&&n<=9){return n;}
    int i=log10(n);
    int k=(int)round(pow(10,i));
    return n%10*k+reverse(n/10);
}

int main() {
    int n;
    scanf("%d", &n);
    printf("%d\n", reverse(n));
    return 0;
}